/**
 * Cellular Potts Model (CPM) for adaptive arrays
 *
 * \file aa_cpm.hpp
 * \author tomby
 * \date 04-01-2009
 **/

/*  Copyright (C) 2009  Tomas 'tomby' Bily

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>. */

#ifndef __DBC_AA_CPM__
#define __DBC_AA_CPM__

namespace dbc {
  namespace cpm {

    class AcceptanceProbability
    {
    public:
      virtual double operator() (double energy_change, double temperature) = 0;
    };

    template<typename aa_type>
    class EnergyFunction
    {
    public:
      typedef blitz::TinyVector<int,aa_type::Dim> IndexType;
      typedef typename aa_type::NumericType CType;

    public:
      virtual double energy_change (IndexType& pos, CType old_type, CType new_type);
    };

    class CellMapper
    {
    };

    template<typename aa_type>
    class CPM
    {
    public:
      enum		{ Dim = aa_type::Dim };

      typedef blitz::TinyVector<int, Dim> IndexType;

    protected:
      aa_type* lattice;
      AcceptanceProbability* acceptance_prob;
      EnergyFunction<aa_type>* energy_func;

    public:

      
    };

    template<typename CPM>
    class cpm_step
    {
    public:
      typedef blitz::TinyVector<int, CPM::Dim> IndexType;

    protected:
      RandomPointGen<CPM::Dim> point_generator;
      
    public:
      
      cpm_step (CPM* cpm)
      {}

      void operator() (double temperature)
      { }

      void one_step (double temperature)
      {
	IndexType p (point_generator ());
	
	
      }
    };

  }; // namespace cpm
}; // namespace dbc

#endif
